package com.jsoft.model;

import com.jsoft.model.core.BaseDao;

import javax.persistence.*;
import java.util.List;

/**
 * Date: 15.08.13
 * Time: 15:13
 */

@Entity
@Table(name = "roles")
public class RoleDao extends BaseDao {
    private String name;
    @ManyToMany(fetch = FetchType.LAZY)
    @JoinTable(name = "roles_rights",
            joinColumns = @JoinColumn(name = "role_id"),
            inverseJoinColumns = @JoinColumn(name = "right_id")
    )
    private List<RightDao> rightList;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public List<RightDao> getRightList() {
        return rightList;
    }

    public void setRightList(List<RightDao> rightList) {
        this.rightList = rightList;
    }
}
